package Boundry;

import Boundry.GenericTools.IPanelOperation;
import Boundry.GenericTools.InputPanel;
import Boundry.GenericTools.TableListPanel;
import javax.swing.JPanel;
import java.awt.SystemColor;
import javax.swing.border.LineBorder;
import java.awt.Color;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.JScrollPane;
import javax.swing.JButton;

import sun.nio.cs.HistoricallyNamedCharset;

public class ViewReuestDataPanel extends TableListPanel implements IPanelOperation 
{
	private JTextField taDateOfCreation;
	private JTextField taInfoSystemName;
	private JTextField taInitatorName;
	private JTextPane taExcuse;
	private JTextPane taCurrentState;
	private JTextPane taProposedChangs;
	private JTextPane taNote;
	private JButton btnOpenFile;



	public ViewReuestDataPanel() 
	{
		super(808,147,"Information About all Step Of The Request");
		tablepanel.setSize(808, 147);
		tablepanel.setLocation(37, 221);
		
		JPanel panel = new JPanel();
		panel.setLayout(null);
		panel.setBorder(new LineBorder(new Color(64, 64, 64)));
		panel.setBackground(SystemColor.window);
		panel.setBounds(37, 22, 808, 182);
		mainPanel.add(panel);
		
		JLabel label_1 = new JLabel("Date of creation:");
		label_1.setBounds(23, 54, 120, 14);
		panel.add(label_1);
		
		taDateOfCreation = new JTextField();
		taDateOfCreation.setEnabled(false);
		taDateOfCreation.setEditable(false);
		taDateOfCreation.setColumns(10);
		taDateOfCreation.setBackground(SystemColor.inactiveCaptionText);
		taDateOfCreation.setBounds(110, 51, 135, 20);
		panel.add(taDateOfCreation);
		
		JLabel label_3 = new JLabel("Excuse: ");
		label_3.setBounds(283, 26, 120, 14);
		panel.add(label_3);
		
		JLabel label_4 = new JLabel("Current State:");
		label_4.setBounds(283, 79, 120, 14);
		panel.add(label_4);
		
		JLabel label_5 = new JLabel("Info System:");
		label_5.setBounds(23, 79, 120, 14);
		panel.add(label_5);
		
		taInfoSystemName = new JTextField();
		taInfoSystemName.setEnabled(false);
		taInfoSystemName.setEditable(false);
		taInfoSystemName.setColumns(10);
		taInfoSystemName.setBackground(SystemColor.inactiveCaptionText);
		taInfoSystemName.setBounds(110, 79, 135, 20);
		panel.add(taInfoSystemName);
		
		taInitatorName = new JTextField();
		taInitatorName.setEnabled(false);
		taInitatorName.setEditable(false);
		taInitatorName.setColumns(10);
		taInitatorName.setBackground(SystemColor.inactiveCaptionText);
		taInitatorName.setBounds(110, 23, 135, 20);
		panel.add(taInitatorName);
		
		JLabel label_6 = new JLabel("Initiator:");
		label_6.setBounds(23, 26, 120, 14);
		panel.add(label_6);
		
		JLabel label_7 = new JLabel("Proposed Change: ");
		label_7.setBounds(283, 127, 111, 14);
		panel.add(label_7);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(375, 127, 416, 41);
		panel.add(scrollPane);
		
		taProposedChangs = new JTextPane();
		scrollPane.setViewportView(taProposedChangs);
		taProposedChangs.setEnabled(false);
		taProposedChangs.setEditable(false);
		taProposedChangs.setBackground(SystemColor.inactiveCaptionText);
		
		JScrollPane scrollPane_1 = new JScrollPane();
		scrollPane_1.setBounds(375, 26, 416, 41);
		panel.add(scrollPane_1);
		
		taExcuse = new JTextPane();
		scrollPane_1.setViewportView(taExcuse);
		taExcuse.setEnabled(false);
		taExcuse.setEditable(false);
		taExcuse.setBackground(SystemColor.inactiveCaptionText);
		
		JScrollPane scrollPane_2 = new JScrollPane();
		scrollPane_2.setBounds(375, 75, 416, 41);
		panel.add(scrollPane_2);
		
		taCurrentState = new JTextPane();
		scrollPane_2.setViewportView(taCurrentState);
		taCurrentState.setEnabled(false);
		taCurrentState.setEditable(false);
		taCurrentState.setBackground(SystemColor.inactiveCaptionText);
		
		JScrollPane scrollPane_3 = new JScrollPane();
		scrollPane_3.setBounds(58, 110, 135, 41);
		panel.add(scrollPane_3);
		
		taNote = new JTextPane();
		taNote.setEnabled(false);
		taNote.setEditable(false);
		taNote.setBackground(SystemColor.inactiveCaptionText);
		scrollPane_3.setViewportView(taNote);
		
		JLabel lblNote = new JLabel("Note:");
		lblNote.setBounds(23, 114, 46, 14);
		panel.add(lblNote);
		
		btnOpenFile = new JButton();
		btnOpenFile.setBounds(217, 110, 42, 31);
		btnOpenFile.setIcon(new ImageIcon(TestingPanel.class.getResource("/ICONS/4_collections_collection.png")));
		panel.add(btnOpenFile);

		hideRefreshButton();
		
		
	}

	public void setDateOfCreation(String taDateOfCreation) {
		this.taDateOfCreation.setText(taDateOfCreation);
	}
	public void setInfoSystemName(String InfoSystemName) 
	{
		this.taInfoSystemName.setText(InfoSystemName);
	}
	public void setInitatorName(String taInitatorName) {
		this.taInitatorName.setText(taInitatorName);
	}
	public void setExcuse(String taExcuse) {
		this.taExcuse.setText(taExcuse);
	}
	public void setCurrentState(String taCurrentState) {
		this.taCurrentState.setText(taCurrentState);
	}
	public void setProposedChangs(String taProposedChangs) {
		this.taProposedChangs.setText(taProposedChangs);
	}
	public void setNote(String taNote) {
		this.taNote.setText(taNote);
	}
	public JButton getBtnOpenFile() {
		return btnOpenFile;
	}

	@Override
	public String apHelpButton() {
		return "Here you can see details about different requests";
	}

	@Override
	public String setTitle() {
 		return "View details abot request";
	}

}
